import request from '@/utils/request'

export default {

  // 根据id删除用户
/*  delete(arr) {
    return request({
      url: `/system/user/deleteByIds`,
      method: 'delete',
      data:arr
    })
  },*/
  // /system/user/delete/{id}
  // 根据id删除用户列表
  delete(id){
    return request({
      url: `/system/user/delete/${id}`,
      method: 'delete',
    })
  },

  // 根据id查用户
  getById(id) {
    return request({
      url: `/system/user/getById/${id}`,
      method: 'get'
    })
  },

  // 模糊查询带分页
  // http://192.168.1.48:8002/api/system/user/getList?pageIndex=1&pageSize=6&username=sdfs
  getList(username,userNickname, page) {
    return request({
      url: `/system/user/getList`,
      method: 'get',
      params: {username,userNickname,pageIndex:page.index,pageSize:page.size}
    })
  },

  // 新增通知
  save(user) {
    return request({
      url: `/system/user/save`,
      method: 'post',
      data: user
    })
  },

  // 修改通知
  update(user) {
    return request({
      url: `/system/user/Update/${user.userId}`,
      method: 'post',
      data: user
    })
  },
  // /system/user/editUserPhoto/{userId}
  // 修改用户头像
  editUserPhoto(id,data){
    return request({
      url: `/system/user/editUserPhoto/${id}`,
      method: 'post',
      data
    })
  },
  // /system/user/getUserListByDepartmentId
  // 根据部门id获取用户列表
  getUserListByDepartmentId(departmentId){
    return request({
      url: `/system/user/getUserListByDepartmentId`,
      method: 'get',
      params: {departmentId}
    })
  },
  // /system/user/getSelectList
  // 选择框用户选择接口
  getSelectList(userNickname){
    return request({
      url: `/system/user/getSelectList`,
      method: 'get',
      params: {userNickname}
    })
  }
}
